Show AllShow All

DATEVALUE

See Also

Returns the serial number of the date represented by date_text. Use DATEVALUE to convert a date represented by text to a serial number.

Syntax

DATEVALUE(date_text)

Date_text    is text that represents a date in a Microsoft Excel date format. For example, "1/30/2008" or "30-Jan-2008" are text strings within quotation marks that represent dates. Using the default date system in Excel for Windows, date_text must represent a date from January 1, 1900, to December 31, 9999. Using the default date system in Excel for the Macintosh, date_text must represent a date from January 1, 1904, to December 31, 9999. DATEVALUE returns the #VALUE! error value if date_text is out of this range.

If the year portion of date_text is omitted, DATEVALUE uses the current year from your computer's built-in clock. Time information in date_text is ignored.

Remarks

Example

The example may be easier to understand if you copy it to a blank worksheet.

ShowHow?

 
1
2
3
4
5
A B
Formula Description (Result)
=DATEVALUE("8/22/2008") Serial number of the text date, using the 1900 date system (39682)
=DATEVALUE("22-AUG-2008") Serial number of the text date, using the 1900 date system (39682)
=DATEVALUE("2008/02/23") Serial number of the text date, using the 1900 date system (39501)
=DATEVALUE("5-JUL") Serial number of the text date, using the 1900 date system, and assuming the computer's built-in clock is set to 2008 (39634)

Note  To view the number as a date, select the cell and click Cells on the Format menu. Click the Number tab, and then click Date in the Category box.